package com.itheima.d1_math;

public class MathTest {
    public static void main(String[] args) {
        //了解Math类提供的方法
        System.out.println(Math.abs(-12));//绝对值

        System.out.println(Math.ceil(3.14));//向上取整

        System.out.println(Math.floor(3.14));//向下取整

        System.out.println(Math.round(3.14));//四舍五入

        System.out.println(Math.pow(2,3));//幂运算

        System.out.println(Math.sqrt(9));//开方

        System.out.println(Math.max(3,5));//最大值

        System.out.println(Math.min(3,5));//最小值

        System.out.println(Math.random());//随机数[0,1)

        System.out.println((int)(Math.random()*10));//随机数[0,9]

    }
}
